﻿using Cinemachine;
using UnityEngine;

public class CameraManager : USaBehaviour
{
    public static CameraManager instance => s_Instance ?? FindObjectOfType<CameraManager>();
    private static CameraManager s_Instance;

    public static Camera mainCamera { get; private set; }
    public static CinemachineBrain cineBrain { get; private set; }
    public static CinemachineVirtualCamera virtualCamera { get; private set; }

    private void Awake()
    {
        DontDestroyOnLoad(this);
        mainCamera = Camera.main;
        cineBrain = FindObjectOfType<CinemachineBrain>();
        virtualCamera = FindObjectOfType<CinemachineVirtualCamera>();
        DontDestroyOnLoad(mainCamera);
        DontDestroyOnLoad(cineBrain);
        DontDestroyOnLoad(virtualCamera);
    }
}